package parser

import (
	"fmt"

	"github.com/xwb1989/sqlparser"
)

func QueryParse(sqlStmt string) (sqlparser.Statement, error) {
	stmt, err := sqlparser.Parse(sqlStmt)
	if err != nil {
		return nil, err
	}
	switch stmt := stmt.(type) {
	case *sqlparser.Select:
	case *sqlparser.Insert:
	case *sqlparser.Update:
	case *sqlparser.Delete:
	default:
		return nil, fmt.Errorf("unsupported SQL statement: %T", stmt)
	}
	return stmt, nil
}
